package com.atguigu.exam.service;

import com.atguigu.exam.entity.ExamRecord;
import com.atguigu.exam.vo.ExamRankingVO;
import com.atguigu.exam.vo.StartExamVo;
import com.atguigu.exam.vo.SubmitAnswerVo;
import com.baomidou.mybatisplus.extension.service.IService;


import java.util.List;

/**
 * 考试记录Service接口
 * 定义考试记录相关的业务方法
 */
public interface ExamRecordService extends IService<ExamRecord> {

    /**
     * 开始考试
     * @param startExamVo
     * @return
     */
    ExamRecord startExam(StartExamVo startExamVo);

    /**
     * 根据id查询考试记录
     * @param id
     * @return
     */
    ExamRecord getExamRecordById(Integer id);

    /**
     * 提交答案
     * @param examRecordId
     * @param answers
     */
    void submitAnswers(Integer examRecordId, List<SubmitAnswerVo> answers);

    /**
     * 删除考试记录
     * @param id
     */
    void deleteExamRecordById(Integer id);

    /**
     * 获取考试排名
     * @param paperId
     * @param limit
     * @return
     */
    List<ExamRankingVO> getExamRanking(Integer paperId, Integer limit);
}